<?php if (!defined('THINK_PATH')) exit();?><html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title><?php echo C('sitename');?></title>
	<meta name="format-detection" content="telephone=no,email=no"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
	<!-- <link href="/Public/Admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/Admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">

    <link href="/Public/Admin/css/animate.min.css" rel="stylesheet">
    <link href="/Public/Admin/css/style.min862f.css?v=4.1.0" rel="stylesheet"> -->
    <script>
        ;
        (function (win, lib) {
            var doc = win.document;
            var docEl = doc.documentElement;
            var metaEl = doc.querySelector('meta[name="viewport"]');
            var flexibleEl = doc.querySelector('meta[name="flexible"]');
            var dpr = 0;
            var scale = 0;
            var tid;
            var flexible = lib.flexible || (lib.flexible = {});
    
            if (metaEl) {
                // console.warn('将根据已有的meta标签来设置缩放比例');
                var match = metaEl.getAttribute('content').match(/initial\-scale=([\d\.]+)/);
                if (match) {
                    scale = parseFloat(match[1]);
                    dpr = parseInt(1 / scale);
                }
            } else if (flexibleEl) {
                var content = flexibleEl.getAttribute('content');
                if (content) {
                    var initialDpr = content.match(/initial\-dpr=([\d\.]+)/);
                    var maximumDpr = content.match(/maximum\-dpr=([\d\.]+)/);
                    if (initialDpr) {
                        dpr = parseFloat(initialDpr[1]);
                        scale = parseFloat((1 / dpr).toFixed(2));
                    }
                    if (maximumDpr) {
                        dpr = parseFloat(maximumDpr[1]);
                        scale = parseFloat((1 / dpr).toFixed(2));
                    }
                }
            }
            if (!dpr && !scale) {
                var isAndroid = win.navigator.appVersion.match(/android/gi);
                var isIPhone = win.navigator.appVersion.match(/iphone/gi);
                var devicePixelRatio = win.devicePixelRatio;
                if (isIPhone) {
                    // iOS下，对于2和3的屏，用2倍的方案，其余的用1倍方案
                    if (devicePixelRatio >= 3 && (!dpr || dpr >= 3)) {
                        dpr = 3;
                    } else if (devicePixelRatio >= 2 && (!dpr || dpr >= 2)) {
                        dpr = 2;
                    } else {
                        dpr = 1;
                    }
                } else {
                    // 其他设备下，仍旧使用1倍的方案
                    dpr = 1;
                }
                scale = 1 / dpr;
            }
            docEl.setAttribute('data-dpr', dpr);
            if (!metaEl) {
                metaEl = doc.createElement('meta');
                metaEl.setAttribute('name', 'viewport');
                metaEl.setAttribute('content', 'initial-scale=' + scale + ', maximum-scale=' + scale +
                    ', minimum-scale=' + scale + ', user-scalable=no');
                if (docEl.firstElementChild) {
                    docEl.firstElementChild.appendChild(metaEl);
                } else {
                    var wrap = doc.createElement('div');
                    wrap.appendChild(metaEl);
                    doc.write(wrap.innerHTML);
                }
            }
    
            function refreshRem() {
                var width = docEl.getBoundingClientRect().width;
                if (width / dpr > 750) {
                    width = 750 * dpr;
                }
                var rem = width / 10;
                docEl.style.fontSize = rem + 'px';
                flexible.rem = win.rem = rem;
            }
            win.addEventListener('resize', function () {
                clearTimeout(tid);
                tid = setTimeout(refreshRem, 100);
            }, false);
            win.addEventListener('pageshow', function (e) {
                if (e.persisted) {
                    clearTimeout(tid);
                    tid = setTimeout(refreshRem, 100);
                }
            }, false);
            if (doc.readyState === 'complete') {
                doc.body.style.fontSize = 12 * dpr + 'px';
            } else {
                doc.addEventListener('DOMContentLoaded', function (e) {
                    doc.body.style.fontSize = 12 * dpr + 'px';
                }, false);
            }
    
            refreshRem();
            flexible.dpr = win.dpr = dpr;
            flexible.refreshRem = refreshRem;
            flexible.rem2px = function (d) {
                var val = parseFloat(d) * this.rem;
                if (typeof d === 'string' && d.match(/rem$/)) {
                    val += 'px';
                }
                return val;
            }
            flexible.px2rem = function (d) {
                var val = parseFloat(d) / this.rem;
                if (typeof d === 'string' && d.match(/px$/)) {
                    val += 'rem';
                }
                return val;
            }
        })(window, window['lib'] || (window['lib'] = {}));
    </script>
	<style>
		html,body,h1,p{
			margin: 0;
			padding: 0;
			border: none;
		}
		html{
			height: 100%;
			position: relative;
		}

		.title{
			position: relative;
			top: 4.4rem;
		}
		.icon>img{
			width: 5.506rem;
			height: 5.506rem;
			/* display: block;
            margin: 0 auto; */
		}
		h1{
			font-size: 0.586rem;
			color: #ffec74;
		}
		.line{
			width: 3.333rem;
			display: block;
			height: 0.063rem;
			margin: 0.3rem auto;
			background-color: #858255;
			border-radius: 70px;
		}
		.title>p{
			font-size: 0.293rem;
			color: #ffec74;
			letter-spacing: 1px;
		}
		.login{
			position: relative;
			top: 1.38rem;
		}
		.form-group{
			width: 82%;
            margin: 0 auto;
            display: flex;
            align-items: center;
            border-bottom: 1px solid #e7e7e7;
		}
        .form-group>span{
		  color:#000;
		  font-size: 0.44rem;
		  font-weight: 500;
	    }
        input:focus{
		  border: none;
		  outline: none;
	    }
		input{
		   flex: 1;
           height: 1.2rem;
           display: block;
		   border: none;
           padding-left: 0.5rem;
           font-size: 0.48rem;
		   box-sizing: border-box;
           color: #000;
		   letter-spacing: 2px;
		   background: transparent;
		}
		input::-webkit-input-placeholder{
			color: #d3d2d2;
			font-size: 0.48rem;
		}
		input::-moz-placeholder{
			color: #d3d2d2;
			font-size: 0.48rem;
		}
		input::-ms-input-placeholder{
			color: #d3d2d2;
			font-size: 0.48rem;
		}
		.yzm{
			position: absolute;
			right: 0;
			font-size: 0.36rem;
			color: #fff98d;
			top: 0.4rem;
			right: 1rem;
		}
		/* .phone{
         left: 1rem;
         top: 0.28rem;
        } */
		.password{
			left: 1rem;
			top: 0.3rem;
		}
		#btn{
			width: 82%;
			height: 1.2rem; 
			margin: 1rem auto;
			background: #08c261; /* 标准的语法（必须放在最后） */
			border: none !important;
			border-radius: 5px;
			display: block;
			color: #fff;
			font-size: 0.43rem;
		}
		.loding img{
			width: 100%;
			height: 100%;
			position: absolute;
			top: 0;
			left: 0;
		}
		.icon img{
			width: 5.33rem;
			display: block;
			margin: 0 auto;
		}
		.success{
		width: 3.2rem;
		height: 3.2rem;
		background-color: #e2e2df;
		opacity: 0.9;
		margin: 0 auto;
		text-align: center;
		position: absolute;
		top: 36%;
		left: 50%;
		margin-left: -1.6rem;
		border-radius: 8px;
		display: none;
		z-index: 1111;
	 }
	 .success p{
		font-size: 0.5rem;
		margin-top: 0.4rem;
		color: #655e32;
	 }
	 .right{
		width: 1.8rem;
		height: 1.296rem;
		margin-top: 0.4rem;
	 }
	</style>
	<style>
		.checkbox {
			color: #ebcf0b;
			width: 7.46rem;
			margin: auto;
			position: relative;
		}
		.checkbox label{
			display:flex;
		}
		.checkbox label::before{
			display: inline-block;
			content:'';
			border: 1px solid #ebcf0b;
			width: .4rem;
			height: .4rem;
			margin-right: .2rem;
		}
		.checkbox input{
			position: absolute;
			top: 0;
			position: absolute;
			z-index: 99999999;
			top: 0;
			left: 0;
			display: block;
			width: 100%;
			height: 100%;
			margin: 0;
			cursor: pointer;
			opacity: 0;
		}

		.checkbox input:checked+label::before{
			background:#ebcf0b;
        }
        #left-backIcon{
            height: 2rem;
            width: 100%;
            display: flex;
            align-items: center;
            padding: 0 24px;
            box-sizing: border-box;
        }
        #left-backIcon img{
            width: 0.72rem;
            height: 0.64rem;
        }
        #left-backIcon span{
            flex: 1;
            padding-left: 16px;
            box-sizing: border-box;
            color: #ebcf0b;
            text-align: left;
            font-size: 0.4rem;
        }
        .call-login{
            width: 100vw;
            padding: 9% 36px;
            box-sizing: border-box;
            color: #000;
            font-weight: 450;
        }
        </style>
</head>
<!-- <style type="text/css">
    body,
    canvas,
    div {
        -moz-user-select: none;
        -webkit-user-select: none;
        -ms-user-select: none;
        -khtml-user-select: none;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    }
    body{
        background:url("/Public/Home/css/img/index_bg.jpg") no-repeat 0 0;
        background-size:cover;
        padding: 0 10px;
    }
    .facesj{
        display: inline-block;
        background-color: #1fa1dc;
        width: 60px;
        height: 32px;
        line-height: 32px;
        border-radius: 3px;
        text-align: center;
        font-size: 14px;
        margin-top:6px;
        border: 1px solid #1fa1dc;
        color: #FFF;
        margin-left:10px;
    }
    h3{
        color: rgba(210, 188, 37, 0.73);
        font-size:20px;
        font-weight: bold;
    }
</style> -->
<body>
<!-- <div class="middle-box text-center loginscreen  animated fadeInDown">
    <div>
        <div>
            <h1 style="height:100px"></h1>
        </div>
        <h3>登 录</h3>
        <form class="m-t" role="form" method="post" action="<?php echo U('Home/Index/login');?>" id="LoginForm">
        <div class="form-group">
            <input type="text" id="username" name="username" class="form-control" placeholder="用户名" required>
        </div>
        <div class="form-group">
            <input type="password" id="password" name="password" class="form-control" placeholder="密码" required>
        </div>
        <button type="submit" class="btn btn-success block full-width m-b">登 录</button>
    </form>
    </div>
</div> -->
<div id="left-backIcon">
    <img src="/Public/Home/img/backIcon.png" alt="">
    <span></span>
</div>
<div class="success">
	<img src="/Public/Home/img/right.png" alt="" class="right">
	<p>注册成功</p>
</div>
<div class="login">
    <form class="m-t" role="form" method="post" action="<?php echo U('Home/Index/register');?>" id="LoginForm">
        <h1 class="call-login">用手机号注册</h1>
		<div class="form-group">
            <!-- <img src="/Public/Home/img/phone.png" alt="" class="phone" style="width:0.52rem;height:0.72rem;"> -->
            <span>用户</span>
			<input type="number" id="username" name="username" class="form-control" placeholder="用户名(手机号注册)" required onkeyup='this.value=this.value.replace(/\D/gi,"")'>
			<input type="hidden" class="input_head" name="headimgurl" value="/Public/Home/img/face/3.png">
		</div>
		<div class="form-group">
            <!-- <img src="/Public/Home/img/password.png" alt="" class="password" style="width:0.6rem;height:0.68rem;"> -->
            <span>密码</span>
			<input type="password" id="password" name="password" class="form-control" placeholder="密码" required>
			<!-- <span class="yzm">获取验证码</span> -->
		</div>
		<div class="form-group">
            <!-- <img src="/Public/Home/img/password.png" alt="" class="password" style="width:0.6rem;height:0.68rem;"> -->
            <span>确认</span>
			<input type="password" id="repassword" name="repassword" class="form-control" placeholder="确认密码" required>
			<!-- <span class="yzm">获取验证码</span> -->
		</div>
		<!--<div class="checkbox" onclick="window.location='<?php echo U('Index/login');?>'">-->
			<!--去登录-->
		<!--</div>-->
		<div class="checkbox" style="display: none">
			<input type="checkbox" id="savePwd">
			<label>发送手机</label>
		</div>
		<div class="form-group" id="fasong" style="display: none">
			<img src="/Public/Home/img/phone.png" alt="" class="phone" style="width:0.52rem;height:0.72rem;">
			<input type="number" id="mobile" name="mobile" class="form-control" placeholder="手机号" disabled="disabled" required>
		</div>
		<button type="submit" class="btn btn-success block full-width m-b" id="btn">注册</button>
	</form>
</div>
<script src="/Public/Admin/js/jquery.min.js?v=2.1.4"></script>
<!-- <script src="/Public/Admin/js/bootstrap.min.js?v=3.3.6"></script> -->

<script src="/Public/Common/js/ajaxForm.js"></script>
<script src="/Public/layer/layer.js"></script>
<script type="text/javascript">

    $(function(){
        //返回
        $("#left-backIcon").click(function(){
           history.back(-1)
        })
        //勾选发送手机
        $('#savePwd').change(function () {
            var che=$(this).is(":checked");
            if (che){
                $('#fasong').css('display','block ');
                $('#mobile').removeAttr('disabled');
            }else{
                $('#fasong').css('display','none ');
                $('#mobile').attr('disabled','disabled');
            }
        });
        //注册
        $('#LoginForm').ajaxForm({
            beforeSubmit: checkForm,
            success: complete,
            dataType: 'json'
        });
        function CheckStr(str){
            var myReg = "[@/'\"#!$%&^*]+";
            var reg = new RegExp(myReg);
            if(reg.test(str)){
                return true;
            } else {
                return false;
            }
        }
        function checkForm(){
            //有发送手机需求
            var che=$(this).is(":checked");

            if (che){
                if ($('#mobile').val().length!=11) {
                    layer.alert('请输入正确手机号码', {icon: 5}, function(index){
                        layer.close(index);
                        $('#mobile').focus();
                    });
                }
                return false;
            }else{
                $('#mobile').focus();
            }
            if( '' == $.trim($('#username').val())){
                layer.alert('用户名不能为空', {icon: 5}, function(index){
                    layer.close(index);
                    $('#username').focus();
                });
                return false;
            }
            console.log(CheckStr($('#username').val()));
            if (CheckStr($('#username').val())) {
                layer.alert('用户名不能有特殊字符', {icon: 5}, function(index){
                    layer.close(index);
                    $('#username').focus();
                });
                return false;
            }

            if ($('#password').val().length < 6) {
                layer.alert('密码长度不能低于6位', {icon: 5}, function(index){
                    layer.close(index);
                    $('#password').focus();
                });
                return false;
            }

            if( '' == $.trim($('#password').val())){
                layer.alert('密码不能为空', {icon: 5}, function(index){
                    layer.close(index);
                    $('#password').focus();
                });
                return false;
            }

            if ($('#password').val() != $('#repassword').val()) {
                layer.alert('两次输入的密码不一致', {icon: 5}, function(index){
                    layer.close(index);
                    $('#password').focus();
                });
                return false;
            }

        }
        function complete(data){
            if(data.status==1){
                $('.btn').attr('disabled','disabled');
                layer.msg(data.info, function(index){
                    layer.close(index);
                    window.location.href=data.url;
                });
            }else{
                layer.msg(data.info);
                $('#password').val('').focus();
                return false;
            }
        }
    });
</script>
</body>

</html>